﻿<?php
/**
* @version		$Id: view.html.php 9764 2007-12-30 07:48:11Z ircmaxell $
* @package		Joomla
* @subpackage	Poll
* @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

jimport( 'joomla.application.component.view');
		
class amapViewadvoircontrats extends JView
{
	var $amap;
	function display($tpl = null)
	{
	$mainframe =& JFactory::getApplication();	
		if($this->amap->adLoggue)
		{
		
			$document =& JFactory::getDocument();
			$pathway  =& $mainframe->getPathway();

			// Adds parameter handling
			$params = $mainframe->getParams();

			$params->def( 'show_page_title', 1 );
			$params->def( 'page_title', 'adhésion');

			if ($this->amap->adLoggue){
				if ($this->amap->adExiste){
				
					// ********************* synthèse des contrats de votre compte
					echo '<div class="amap_bloc">';
					echo '<h3 class="amap_titre">Synthèse de vos contrats</h3>';

					if(isset($this->amap->adhesion) || isset($this->amap->adhesionFutur)){
						// affichage des abonnements souscrits
						if (isset($this->amap->aboSouscrit)) {
							echo '<h4>Contrats souscrits</h4>';
////
////							$this->amap->aboSouscrit->commandes = array (
////									0=>array ('href'=>'index.php?option=com_amap&view=advoirabo',
////											'param'=>array('abo'=>'Nom'),
////											'icone'=>'calendrier.png',
////											'title'=>'Voir toutes les distributions'),
////									1=>array ('href'=>'index.php?option=com_amap&view=advoirdistrib&distrib=next',
////											'param'=>array('abo'=>'Nom'),
////											'icone'=>'distrib.png',
////											'title'=>'Voir la prochaine distribution')
////							);
							$this->amap->aboSouscrit->afficheTable(); 
						}
						// affichage des abonnements proposés
						if (isset($this->amap->aboPropose)) {
							echo '<h4>Contrats disponibles</h4>';
							$this->amap->aboPropose->commandes = array (
									0=>array('href'=>'index.php?option=com_amap&view=adabo',
										'param'=>array('abo'=>'Nom'),
										'icone'=>'file_add.png',
										'title'=>'Souscrire'),
									1=>array ('href'=>'index.php?option=com_amap&view=advoirabo',
										'param'=>array('abo'=>'Nom'),
										'icone'=>'file_date.png',
										'title'=>'Voir les livraisons')
								);
							$this->amap->aboPropose->afficheTable(); 
						}
					} else {
						echo '<p><strong>Aucune demande d\'abonnement ne peut être formulée tant que vous n\'avez pas fait une demande d\'adhésion.</strong></p>';
					}
					
					echo '</div>';

				}
			}
		}
parent::display($tpl);
	}
}
?>
